package com.dayouzi.crawler_monitor.mapper;

import com.dayouzi.crawler_monitor.pojo.entity.FileJson2;
import com.dayouzi.crawler_monitor.pojo.query.*;
import com.dayouzi.crawler_monitor.pojo.vo.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author DaYouZi
 * @since 2023-03-06
 */
@Mapper
@Repository
public interface CrawlerMapper {

    List<CrawlerListVO> listPage(CrawlerListQuery crawlerListQuery);

    CrawlerDetailVO getCrawlerDetail(CrawlerDetailQuery crawlerDetailQuery);

    ArrayList<String> getPersonList();

    ArrayList<Integer> getSpiderTypeList();

    ArrayList<String> getMachineList(@Param("person") String person, @Param("spiderType") Integer spiderType);

    ArrayList<String> getProjectNameList(@Param("person") String person, @Param("spiderType") Integer spiderType);

    ArrayList<CrawlerPreviewVO> getCrawlerPreview(Integer id);

    ArrayList<String> getCrawlerDetailTypes(ErrorTypeListQuery errorTypeListQuery);

    int updateStatus(@Param("did") Integer did, @Param("status") Integer status);

    List<CrawlerDetailListVO> getCrawlerDetailList(CrawlerDetailQuery crawlerDetailQuery);

    int updatePerson(@Param("id") Integer id, @Param("person") String person);

    int multipleHandle(@Param("status") Integer status, @Param("arr") List arr);

    int insertToppingData(@Param("userId") Integer userId, @Param("timestampNow")long timestampNow, @Param("insertList") List insertList);

    Integer getToppingData(@Param("userId") Integer userId, @Param("dataId") Integer dataId);

    int updateToppingData(@Param("userId") Integer userId, @Param("timestampNow")long timestampNow, @Param("updateList") List<Integer> updateList);

    int deleteToppingData(@Param("userId") Integer userId, @Param("arr") List arr);

    int getCrawlerCount();

    int getErrorCrawlerCount();

    void changePdf(Integer id);

    void updatePdf(@Param("id") Integer id, @Param("isPdf") Integer isPdf);

    int updateRemarks(@Param("id") Integer id, @Param("remarks") String remarks);

    ArrayList<ScheduledTaskVO> getScheduledTask(String person);

    int updateScheduledName(@Param("id") Integer id, @Param("scheduledName") String scheduledName, @Param("scheduledId") Integer scheduledId);

    int unupdateScheduledName(Integer id);

    ArrayList<String> querySearchAsync(@Param("codeName") String codeName, @Param("person") String person, @Param("spiderType") Integer spiderType);

    List<HonorListVO> honorListPage(HonorListQuery honorListQuery);

    int honorUpdateData(@Param("id") Integer id, @Param("status") Integer status);

    int honorMultipleHandle(@Param("status") Integer status, @Param("arr") List arr);

    ArrayList<String> honorAuthorList();

    ArrayList<String> honorPrizeList();

    CompanyRecordDetailVO getCompanyRecordDetail(Integer id);

    CrawlerPolicyVO getCrawlerDataById(CrawlerDataQuery crawlerDataQuery);

    int updateCommit(CrawlerDataUpdateVO crawlerDataUpdateVO);

    int ontTouchIgnore(ArrayList<Integer> ids);

    String getAuthor(String author);

    List<String> getPdfUrl(@Param("tableId") Integer tableId, @Param("tableName") String tableName);

    int insertPdfUrl(@Param("id") Integer id, @Param("tableName") String tableName, @Param("intro") String intro);

    int addPolicyData(AddDataPolicyQuery addDataQuery);

    ArrayList<String> getDropdownList(Integer id);

    int setValid(@Param("isValid") Integer isValid, @Param("arr") List arr);

    CrawlerValidCountVO getCrawlerValidCount(String person);

    ArrayList<Integer> selectErrorIds(@Param("id") Integer id, @Param("type") String type);

    int updateIntro(@Param("id") Integer id, @Param("tableName") String tableName, @Param("intro") String intro);

    ArrayList<String> getFileList(@Param("dataId") Integer dataId, @Param("tableName") String tableName);

    int updateInfoCommit(CrawlerDataUpdateVO crawlerDataUpdateVO);

    String getOldIntro(@Param("id") Integer id, @Param("tableName") String tableName);

    int addPolicyInfoData(@Param("id") int id, @Param("info") String info);
}
